Catch-22 (1961) by Joseph Heller

"There was only one catch and that was Catch-22, which specified that a concern for one's own safety in the face of dangers that were real and immediate was the process of a rational mind. Orr was crazy and could be grounded. All he had to do was ask; and as soon as he did, he would no longer be crazy and would have to fly more missions. Orr would be crazy to fly more missions and sane if he didn't, but if he was sane, he had to fly them. If he flew them, he was crazy and didn't have to; but if he didn't want to, he was sane and had to. Yossarian was moved very deeply by the absolute simplicity of this clause of Catch-22 and let out a respectful whistle."

https://www.merriam-webster.com/dictionary/catch-22#note-2

"The novel's catch-22 was as follows: a combat pilot was crazy by definition (he would have to be crazy to fly combat missions) and since army regulations stipulated that insanity was justification for grounding, a pilot could avoid flight duty by simply asking, but if he asked, he was demonstrating his sanity (anyone who wanted to get out of combat must be sane) and had to keep flying."